package com.edwin.websitebe.controller;

import com.edwin.websitebe.model.Game;
import com.edwin.websitebe.model.Order;
import com.edwin.websitebe.service.GameService;
import com.edwin.websitebe.service.OrderGameService;
import com.edwin.websitebe.service.OrderService;
import com.edwin.websitebe.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping("/pageGameByCode")
    public ResultVO pageGameByCode(@RequestParam String code) {

        List<Game> games = orderService.listGameByOrderCode(code);


        return new ResultVO().success(games);
    }


}
